﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FSS.Core.Controls;
using Ext.Net;
using FSS.BLL.Entities;
using FSS.BLL.Services;

namespace SalesManagement.Controls.List
{
    public partial class ScreenForm : BaseControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void Show()
        {
            this.winDetails.Show();
        }
        public void Show(string screenID)
        {
            //flag = 0;
            //ScreenEntity screenE = new ScreenEntity();
            //ScreenService screenS = ScreenService.GetInstance();
            //screenE.screen_id = screenID;
            //screenE = screenS.getScreenById(screenE);
            //if (null == screenE)
            //    return;
            //txtID.Text = screenE.screen_id;
            //txtScreenName.Text = screenE.screen_name;
            //txtIcon.Text = screenE.icon;
            //txtUrl.Text = screenE.url;
            //txtNote.Text = screenE.note;
            //txtParent.Text = screenE.parent;
            //this.winDetails.Show();
        }
        public void ShowAndReset()
        {
            this.FormPanel1.Reset();
            this.winDetails.Show();
        }
        protected void btnSave_Click(object sender, DirectEventArgs e)
        {
        //    Save(txtID.Text, txtScreenName.Text, "", "", "", txtParent.Text);
        //    ScreenEntity screenE = new ScreenEntity();
        //    ScreenService screenS = ScreenService.GetInstance();
        //    List<ScreenEntity> lstScreen = (List<ScreenEntity>)screenS.getAllScreen();
        //    if (null != lstScreen)
        //    {
        //        GridStore.DataSource = lstScreen;
        //        GridStore.DataBind();
        //    }
        //    this.winDetails.Hide();

        }
        protected void Save(string screenID, string screenName, string screenIcon, string screenUrl, string screenNote, string screenParent)
        {
            //    ScreenEntity screenE = new ScreenEntity();
            //    ScreenService screenS = ScreenService.GetInstance();
            //    screenE.screen_name = screenName;
            //    screenE.screen_id = screenID;
            //    screenE.parent = screenParent;
            //    screenE.icon = screenIcon;
            //    screenE.icon = screenUrl;
            //    screenE.note = screenNote;
            //    if (flag != 0)
            //        screenS.insertScreen(screenE);
            //    else
            //        screenS.updateScreen(screenE);
            //    flag = 1;
            //}
            //public Store GridStore { get; set; }
        }
    }
}